<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <form id="my-form" class="am-form tpl-form-line-form" enctype="multipart/form-data" method="post">
                    <div class="widget-body">
                        <fieldset>
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">满额包邮设置</div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-form-label form-require">
                                    是否满额包邮
                                </label>
                                <div class="am-u-sm-9">
                                    <label class="am-radio-inline">
                                        <input type="radio" name="mail[is_open]" value="1"
                                               data-am-ucheck
                                            <?= $info['is_open'] == '1' ? 'checked' : '' ?>
                                               required>
                                        开启
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" name="mail[is_open]" value="0"
                                               data-am-ucheck
                                            <?= $info['is_open'] == '0' ? 'checked' : '' ?>>
                                        关闭
                                    </label>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-form-label form-require">
                                    包邮所需订单金额
                                </label>
                                <div class="am-u-sm-9">
                                    <input type="number" class="tpl-form-input" name="mail[full_mail_money]"
                                           value="<?= isset($info['full_mail_money']) ? $info['full_mail_money'] : '' ?>" required>
                                    <input type="hidden" name="mail[mail_id]" value="<?= isset($info['mail_id']) ? $info['mail_id'] : '' ?>">
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-form-label form-require">
                                    设置不包邮地区
                                </label>
                                <div class="am-u-sm-9">
                                    <div class=" am-scrollable-horizontal">
                                        <table class="regional-table am-table am-table-bordered am-table-centered am-margin-bottom-xs">
                                            <tbody>
                                            {{notempty name="info['no_mail_city_name']"}}
                                            <tr>
                                                <td class="am-text-left">
                                                    <p class="selected-content am-margin-bottom-xs">{{$info['no_mail_city_name']}}</p>
                                                 </td>
                                             </tr>
                                            {{/notempty}}
                                            <tr>
                                                <td class="am-text-left">
                                                    <a class="add-region am-btn am-btn-default am-btn-xs"
                                                       href="javascript:;">
                                                        <i class="iconfont icon-dingwei"></i>
                                                        点击添加区域
                                                    </a>
                                                </td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg">
                                    <button type="submit" class="j-submit am-btn am-btn-secondary">提交
                                    </button>
                                </div>
                            </div>
                        </fieldset>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<div class="regional-choice"></div>
<script src="assets/store/js/checkregion.js"></script>
<script>
    $(function () {

        // 初始化区域选择界面
        var datas = JSON.parse('<?= $regionData ?>');

        // 配送区域表格
        new Delivery({
            table: '.regional-table',
            regional: '.regional-choice',
            datas: datas
        });

        /**
         * 表单验证提交
         * @type {*}
         */
        $('#my-form').superForm();

    });
</script>
